import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
  //  hash 模式。
  history: createWebHashHistory(),
  routes: [
    // 登录、注册
    {
      path: '/',
      component: () => import('../views/login/index.vue')
    },
    {
      path: '/print',
      component: () => import('../components/Main/index.vue'),
      children: [
        // 工作站管理
        {
          path: 'manage',
          component: () => import('../views/printManage/index.vue')
        },
        // 打印记录
        {
          path: 'log',
          component: () => import('../views/log/index.vue')
        },
        // 问题反馈
        {
          path: 'problem',
          component: () => import('../views/problem/index.vue'),
          children: [
            {
              path: 'list',
              name: 'list',
              meta: {
                title: '问题列表'
              },
              component: () => import('../views/problem/list.vue')
            },
            {
              path: 'hotspot',
              name: 'hotspot',
              meta: {
                title: '热点问题'
              },
              component: () => import('../views/problem/hotspot.vue')
            },
            {
              path: '/list/add',
              meta: {
                title: '问题列表 / 新增'
              },
              component: () => import('../views/problem/add.vue')
            },
            {
              path: '/list/details/:id',
              meta: {
                title: '问题列表 / 详情'
              },
              component: () => import('../views/problem/details.vue')
            }
          ]
        }
      ]
    }
  ]
})

export default router
